<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ page contentType="text/html;charset=UTF-8" language="java"%>
<!DOCTYPE html>
<html>
<head>
<title>更改密码</title>
</head>
<body>
  <div style="text-align: center;">
    <form name="change-password" action="account-handler" method="post">
      <fieldset>
        <legend>更改账户密码</legend>
        <input type="hidden" name="operate" value="modify-password" readonly="readonly">
        <label>当前密码<input type="password" name="old-password"></label><br>
        <label>重设密码<input type="password" name="new-password"></label><br>
        <label>确认密码<input type="password" name="confirm-password"></label><br>
        <input type="submit" value="修改" onclick="return verify()">
      </fieldset>
    </form>
  </div>
</body>
<script language="JavaScript">
  function verify() {
    var oldPassword = document['change-password']["old-password"].value;
    var newPassword = document['change-password']["new-password"].value;
    var confirmPassword = document['change-password']["confirm-password"].value;
    if (oldPassword === null || newPassword === null || confirmPassword === null)
      return false;
    if (oldPassword === "" || newPassword === "" || confirmPassword === "")
      return false;
    return !(oldPassword === newPassword || newPassword !== confirmPassword);
  }
</script>
</html>
